package 尚硅谷juc大厂.test6;


public class Test66 {

    Object object=new Object();

    public static void main(String[] args) {

    }

    public void add(){
        /**
         * synchronized同步代码
         */
        synchronized (object){
            System.out.println("hello");
        }
    }
}
